package com.bl.student.dao.repository;

import com.bl.student.common.enums.ApplyType;
import com.bl.student.dao.model.StudioEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by liangweikang on 18/3/10.
 */
public interface StudioRespository extends PagingAndSortingRepository<StudioEntity, String> {

    List<StudioEntity> findByUserIdAndBizId(String userId, String id);

    Page<StudioEntity> findAllByTypeOrderByCreateTimeDesc(ApplyType type,Pageable page);

    Page<StudioEntity> findBybizIdOrderByCreateTimeDesc(String bizId,Pageable page);

    Long countByBizId(String id);

}
